package tests;
import firewall.*;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

import firewall.Paquete;
import firewall.ReglaEspecificaIp;

public class TestReglaGeneral extends TestContenedor{

	@Before
	public void setUp(){
		super.setUp();
		this.reglaIp3.setIpOrigenPiso("190");
		this.reglaIp3.setIpOrigenTecho("195");
		
		this.reglaIp4.setIpDestinoPiso("250");
		this.reglaIp4.setIpDestinoTecho("300");
		
		
		this.reglaPuerto3.setPuertoPiso(10);
		this.reglaPuerto3.setPuertoTecho(20);
		
		
		this.reglaPuerto4.setPuertoPiso(30);
		this.reglaPuerto4.setPuertoTecho(40);
	}	
	
	
	
	@Test
	public void testMatchean() {
		
		assertTrue(this.reglaIp3.matchea(this.paquete));
		assertTrue(this.reglaPuerto3.matchea(this.paquete));
		/*assertFalse(this.reglaIp4.matchea(this.paquete));
		
		assertFalse(this.reglaPuerto4.matchea(this.paquete));*/
	}
	
	@Test
	public void testNoMatchean() {
		
		
		assertFalse(this.reglaIp4.matchea(this.paquete));
		
		assertFalse(this.reglaPuerto4.matchea(this.paquete));
	}
}
